<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="zh-cn" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Manlibrary</title>
<style type="text/css">
.style1 {
	border-style: solid;
	border-width: 1px;
}
.style2 {
	text-align: center;
}
</style>
</head>

<body>
	<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
session_start();
$UserName = $_SESSION['UserName'];
$UserID = $_SESSION['ID'];
include_once('Mysql_connect.inc');//启动连接，连接名：$conn

$result1 = mysqli_query($conn, "SELECT staff_card, name FROM staff WHERE staff_id ='$UserID'");

if ($result1){
?>
<table class="style1" style="width: 100%">
	<tr>
		<td class="style2" style="width: 139px">
		<h3>Bid</h3>
		</td>
		<td class="style2" style="width: 125px">
		<h3>Student ID</h3>
		</td>
		<td class="style2" style="width: 133px">
		<h3>Student name</h3>
		</td>
		<td class="style2" style="width: 242px">
		<h3>Title</h3>
		</td>
		<td class="style2">
		<h3>Booked date</h3>
		</td>
		<td class="style2">
		<h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</h3>
		</td>
	</tr>
<?php
$result = mysqli_query($conn, 'SELECT bid, roll_id, name, title, booked_date FROM bookingrecord');
while (($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) != NULL) { ?>
	<tr>
		
		<td style="width: 139px">&nbsp; <?php  echo $bid =  $row['bid'] ; ?></td>
		<td style="width: 125px">&nbsp;  <?php  echo $roll_id =  $row['roll_id'] ; ?></td>
		<td style="width: 133px">&nbsp; <?php  echo  $row['name'] ; ?></td>
		<td style="width: 242px">&nbsp;  <?php  echo  $row['title'] ; ?></td>
		<td>&nbsp;  <?php  echo  $row['booked_date']  ; ?></td>
		<td>&nbsp; <a href="CP3110_Manlibrary_do.php?bid=<?php echo $bid;?>&roll_id=<?php echo $roll_id;?>">Cancel </a></td>
	</tr>

    <?php 
}
mysqli_free_result($result);
echo '</table>';
}
else echo "You are not Manger";
?>
</table>
<?php
include_once('Mysql_unconnect.inc'); //断开连接
?>


</body>

</html>
